[FeatureBranch/DoNotReview][Chrome Next] Keep all AI buttons #260937
Merged
Dosant merged 2 commits intoelastic:feature/chrome-nextfrom Apr 2, 2026
Merged
[FeatureBranch/DoNotReview][Chrome Next] Keep all AI buttons #260937Dosant merged 2 commits intoelastic:feature/chrome-nextfrom
Dosant merged 2 commits intoelastic:feature/chrome-nextfrom
Conversation
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
kowalczyk-krzysztof
approved these changes
Apr 2, 2026
| set(config?: ChromeNextGlobalSearchConfig): void; | ||
| }; | ||
| }; | ||
| /** {@inheritdoc ChromeNext} */ |
Member
There was a problem hiding this comment.
TIL about @inheritdoc. I've been copy pasting docs everywhere
| order: 1001, | ||
| }); | ||
|
|
||
| // TODO: Chrome-Next hack — dual registration needed because Chrome Next doesn't render |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the AI assistant buttons not appearing in the Chrome Next header.
Relates to #260010
Problem
Chrome Next renders the header differently from the legacy chrome — it does not render
HeaderNavControls(thechrome.navControls.registerRightmount points). All AI assistant buttons (Security, Observability, Search, AI experience picker) relied exclusively onregisterRight, so they were invisible when Chrome Next was enabled.Additionally, the existing
chrome.next.aiButton.set()API was a single-slot, last-write-wins design — only the Agent Builder could use it, and other AI experiences had no way to register their buttons.Changes
1. Multi-registration
aiButton.register()APIReplaced
chrome.next.aiButton.set(node)withchrome.next.aiButton.register(button):ReactNode | MountPointas content (viaChromeExtensionContent), so plugins can reuse their existingmountfunctionsBehaviorSubject<ReadonlySet<ChromeNextAiButton>>to manage registrationsAiButtonSlot2. Dual registration in all AI plugins
Each AI plugin now registers with both
chrome.navControls.registerRight(legacy) andchrome.next.aiButton.register(Chrome Next). This ensures buttons appear regardless of which chrome is active. All dual registrations are marked with// TODO: Chrome-Next hackcomments linking to #260010 for cleanup once Chrome Next is the only chrome.Plugins updated:
elastic_assistant(Security AI Assistant)observability_ai_assistant_app(Observability AI Assistant)search_assistant(Search AI Assistant)ai_assistant_management/selection(AI experience picker)agent_builder(Agent Builder — already had Chrome Next registration, updated to new API)3. Type consolidation
Moved all Chrome Next types into
src/core/packages/chrome/browser/src/chrome_next/:ChromeNextAiButton,ChromeNextHeaderConfig,ChromeNextGlobalSearchConfig,ChromeNextInternalChromeNextinterface inbrowser-internal-types4. Empty mount point layout fix
Fixed phantom gaps in the Chrome Next trailing actions caused by AI buttons that register but render nothing (e.g., when a solution's assistant is not enabled). Applied
mountPointContainerCssto both theMountPointandReactNodebranches inHeaderExtensionso empty wrappers collapse out of the flex layout.